home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 November / CPNL0711.ISO / boekhoud / finan / BADGER finance v1.0 beta 2.exe / xampplite / phpMyAdmin / libraries / auth / config.auth.lib.php next >
PHP Script  |  2005-12-08  |  4KB  |  141 lines

  1. <?php
  2. /* $Id: config.auth.lib.php,v 2.18 2005/12/08 20:47:24 nijel Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. // +--------------------------------------------------------------------------+
  6. // | Set of functions used to run config authentication (ie no                |
  7. // | authentication).                                                         |
  8. // +--------------------------------------------------------------------------+
  9.  
  10.  
  11. /**
  12.  * Displays authentication form
  13.  *
  14.  * @return  boolean   always true
  15.  *
  16.  * @access  public
  17.  */
  18. function PMA_auth()
  19. {
  20.     return TRUE;
  21. } // end of the 'PMA_auth()' function
  22.  
  23.  
  24. /**
  25.  * Gets advanced authentication settings
  26.  *
  27.  * @return  boolean   always true
  28.  *
  29.  * @access  public
  30.  */
  31. function PMA_auth_check()
  32. {
  33.     return TRUE;
  34. } // end of the 'PMA_auth_check()' function
  35.  
  36.  
  37. /**
  38.  * Set the user and password after last checkings if required
  39.  *
  40.  * @return  boolean   always true
  41.  *
  42.  * @access  public
  43.  */
  44. function PMA_auth_set_user()
  45. {
  46.     return TRUE;
  47. } // end of the 'PMA_auth_set_user()' function
  48.  
  49.  
  50. /**
  51.  * User is not allowed to login to MySQL -> authentication failed
  52.  *
  53.  * @global  string    the MySQL error message PHP returns
  54.  * @global  string    the connection type (persistent or not)
  55.  * @global  string    the MySQL server port to use
  56.  * @global  string    the MySQL socket port to use
  57.  * @global  array     the current server settings
  58.  * @global  string    the font face to use in case of failure
  59.  * @global  string    the default font size to use in case of failure
  60.  * @global  string    the big font size to use in case of failure
  61.  * @global  boolean   tell the "PMA_mysqlDie()" function headers have been
  62.  *                    sent
  63.  *
  64.  * @return  boolean   always true (no return indeed)
  65.  *
  66.  * @access  public
  67.  */
  68. function PMA_auth_fails()
  69. {
  70.     global $php_errormsg, $cfg;
  71.  
  72.     $conn_error = PMA_DBI_getError();
  73.     if (!$conn_error) {
  74.         if (isset($php_errormsg)) {
  75.             $conn_error = $php_errormsg;
  76.         } else {
  77.             $conn_error = $GLOBALS['strConnectionError'];
  78.         }
  79.     }
  80.  
  81.     // Defines the charset to be used
  82.     header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
  83.     /* HTML header */
  84.     $page_title = $GLOBALS['strAccessDenied'];
  85.     require('./libraries/header_meta_style.inc.php');
  86.     ?>
  87. </head>
  88.  
  89. <body>
  90. <br /><br />
  91. <center>
  92.     <h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION); ?></h1>
  93. </center>
  94. <br />
  95. <table border="0" cellpadding="0" cellspacing="3" align="center" width="80%">
  96.     <tr>
  97.         <td>
  98.     <?php
  99.     echo "\n";
  100.     $GLOBALS['is_header_sent'] = TRUE;
  101.  
  102.     //TODO: I have included this div from libraries/header.inc.php to work around
  103.     //      an undefined variable in tooltip.js, when the server
  104.     //      is not responding. Work has to be done to merge all code that
  105.     //      starts the page (DOCTYPE and this div) to one place
  106.     ?>
  107.     <div id="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div>
  108.     <?php
  109.  
  110.     // if we display the "Server not responding" error, do not confuse users
  111.     // by telling them they have a settings problem
  112.     // (note: it's true that they could have a badly typed host name, but
  113.     //  anyway the current $strAccessDeniedExplanation tells that the server
  114.     //  rejected the connection, which is not really what happened)
  115.     // 2002 is the error given by mysqli
  116.     // 2003 is the error given by mysql
  117.  
  118.     if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
  119.         echo '<p>' . $GLOBALS['strAccessDenied'] . '</p>' . "\n";
  120.     } else {
  121.         if (!isset($GLOBALS['errno']) || (isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) && $GLOBALS['errno'] != 2003) {
  122.             // Check whether user has configured something
  123.             if ($_SESSION['PMA_Config']->source_mtime == 0) {
  124.                 echo '<p>' . sprintf($GLOBALS['strAccessDeniedCreateConfig'], '<a href="scripts/setup.php">', '</a>') . '</p>' . "\n";
  125.             } else {
  126.                 echo '<p>' . $GLOBALS['strAccessDeniedExplanation'] . '</p>' . "\n";
  127.             }
  128.         }
  129.         PMA_mysqlDie($conn_error, '');
  130.     }
  131. ?>
  132.         </td>
  133.     </tr>
  134. </table>
  135. <?php
  136.     require_once('./libraries/footer.inc.php');
  137.     return TRUE;
  138. } // end of the 'PMA_auth_fails()' function
  139.  
  140. ?>
  141.